package com.own.business.level.controller.user;

import com.own.business.level.business.service.LevelUserHistoryService;
import com.own.business.level.entity.query.LevelUserHistoryQuery;
import com.own.business.level.entity.vo.LevelUserHistoryVo;
import com.own.component.common.base.controller.BaseController;
import com.own.component.common.model.PageModel;
import com.own.component.common.model.R;
import com.own.component.common.model.ResultModel;
import com.own.component.log.operation.aop.LogOperationAop;
import com.own.component.log.operation.aop.LogOperationModuleAop;
import com.own.constant.ConstantApiPrefix;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * UserLevelUserHistoryController
 *
 * @author chenxueli
 * @date 2022-07-25 15:16:00
 */
@Tag(name = "用户经验获取流水" + ConstantBeanSuffix.USER_CLIENT + ConstantBeanSuffix.CONTROLLER)
@RestController
@LogOperationModuleAop("用户经验获取流水" + ConstantBeanSuffix.USER_CLIENT)
@RequestMapping(ConstantApiPrefix.BASE_API_V1_PREFIX + ConstantApiPrefix.USER_CLIENT + "level/user/history")
public class UserLevelUserHistoryController extends BaseController {

    @Resource
    private LevelUserHistoryService levelUserHistoryService;

    @LogOperationAop
    @Operation(summary = "分页查询信息")
    @PostMapping("/page")
    public ResultModel<PageModel<LevelUserHistoryVo>> page(
            @RequestBody LevelUserHistoryQuery query
    ) {
        var pageModel = levelUserHistoryService.page(query);
        return R.success(pageModel);
    }

}
